<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="yk.*" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="userBean" class="com.walter.domain.Employee"
	scope="request">
	<jsp:setProperty name="userBean" property="*"></jsp:setProperty>
</jsp:useBean>
<jsp:useBean id="regist" class="yk.UserRegister" scope="request"></jsp:useBean>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<%
		String id = request.getParameter("id");
		String name = request.getParameter("name");
		String sex = request.getParameter("gender");
		
		String pass = request.getParameter("password");
		Class.forName("com.mysql.jdbc.Driver");//加载驱动
		String url = "jdbc:mysql:///directroute";
		String user = "root";
		String password = "root";
		Connection con = DriverManager.getConnection(url, user, password);
		Statement st = con.createStatement();
		String sql = "update employee set sex="+sex+",password=" + pass + " where id=" + id + " and status=1";
		
		st.executeUpdate(sql);
		
		response.sendRedirect(request.getContextPath() + "/admin/welcome.jsp");
	%>
</body>
</html>